package demo05.FactoryPattern.store;

import demo05.FactoryPattern.Factory.NYPizzaIngredientFactory;
import demo05.FactoryPattern.FactoryImp.PizzaIngredientFactory;
import demo05.FactoryPattern.pizza.CheesePizza;
import demo05.FactoryPattern.pizza.ClamPizza;
import demo05.FactoryPattern.pizza.PepperoniPizza;
import demo05.FactoryPattern.pizza.VeggiePizza;
import demo05.FactoryPattern.pizzaImp.Pizza;
import demo05.FactoryPattern.storeImp.PizzaStore;

public class NYPizzaStore extends PizzaStore{
	protected Pizza createPizza(String item) {
		Pizza pizza = null;
		PizzaIngredientFactory ingredientFactory = 
			new NYPizzaIngredientFactory();
 
		if (item.equals("cheese")) {
  
			pizza = new CheesePizza(ingredientFactory);
			pizza.setName("纽约式奶酪比萨");
  
		} else if (item.equals("veggie")) {
 
			pizza = new VeggiePizza(ingredientFactory);
			pizza.setName("纽约风格蔬菜比萨");
 
		} else if (item.equals("clam")) {
 
			pizza = new ClamPizza(ingredientFactory);
			pizza.setName("纽约蛤蜊比萨");
 
		} else if (item.equals("pepperoni")) {

			pizza = new PepperoniPizza(ingredientFactory);
			pizza.setName("纽约风格的意大利辣味香肠比萨");
 
		} 
		return pizza;
	}
}
